<template>
  <div class="actordetail">
    <div class="actorbox">
      <div class="header">
        <van-nav-bar left-arrow @click-left="onClickLeft" />
      </div>
      <div class="content" v-for="item in actor" :key="item.id">
        <div class="presonintrduce">
          <div class="profilephoto">
            <img :src="item.avatar" class="image" />
          </div>
          <div class="cname">{{ item.name_cn }}</div>
          <div class="ename">{{ item.name_en }}</div>
          <div class="attention">关注</div>
          <div class="num">138585人关注</div>
        </div>
        <div class="intro">
          <h3 class="selftitle">简介</h3>
          <div class="introcontent">
            <p>
              {{ item.introduce }}
            </p>
            <i>查看更多></i>
          </div>
        </div>
        <div class="intro works">
          <h3 class="selftitle">个人作品</h3>
          <div
            class="workintro"
            v-for="(item1, index) in item.movies"
            :key="index"
          >
            <img :src="item1.img" alt="" class="workImg" />
            <div class="workdetail">
              <div class="worktitle">{{ item1.title }}</div>
              <div class="workscore">
                评分<span>{{ item1.rating_averages }}</span>
              </div>
              <div class="workactor">
                演员<span>{{ item.name }}</span>
              </div>
              <div class="worktime">
                上映时间<span>{{ item1.year }}</span>
              </div>
            </div>
          </div>
        </div>
        <div class="intro photo">
          <div class="selftitle">相册</div>
          <div class="photoshow">
            <div class="left">
              <img :src="photo1" class="photo1" />
              <img :src="photo3" class="photo3" />
              <img :src="photo4" class="photo4" />
            </div>
            <div class="right">
              <img :src="photo2" class="photo2" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import profilephoto from '@/assets/images/actordetail/profilephoto.png'
import workImage01 from '@/assets/images/actordetail/works1.png'
import workImage02 from '@/assets/images/actordetail/works2.png'
import photo1 from '@/assets/images/actordetail/selfphoto1.png'
import photo2 from '@/assets/images/actordetail/selfphoto2.png'
import photo3 from '@/assets/images/actordetail/selfphoto3.png'
import photo4 from '@/assets/images/actordetail/selfphoto4.png'
import axios from 'axios'

export default {
  data() {
    return {
      profilephoto,
      photo1,
      photo2,
      photo3,
      photo4,
      actor: [],
      list: [
        {
          workimg: workImage01,
          title: '忍者之国',
          score: '9.0',
          actor: '大野智',
          time: '2017年7月1日',
        },
        {
          workimg: workImage02,
          title: '新•哥斯拉',
          score: '9.0',
          actor: '长谷川博己，竹…',
          time: ' 2016年7月29日',
        },
      ],
    }
  },
  created() {
    console.log(this.$route.params.id)
    axios
      .get(`http://bufantec.com/api/douban/movie/playerInfo`, {
        params: { playerId: this.$route.params.id },
      })
      .then((res) => {
        // console.log(res.data);
        this.actor = res.data
        console.log(this.actor)
      })
  },
  mounted() {},
  methods: {
    onClickLeft() {
      this.$router.go(-1)
    },
  },
}
</script>
<style lang="scss" scoped>
.actordetail {
  background: #22262d url('../../assets/images/actordetail/bg.png') no-repeat
    center -20px;
  width: 750px;
  height: 1600px;
}
[class*='van-hairline']::after {
  border: 0 solid transparent;
}
/deep/ .van-nav-bar .van-icon {
  color: #fff;
}
/deep/ .van-ellipsis {
  color: #fff;
  font-size: 32px;
}
.van-nav-bar {
  background-color: transparent;
}
.header {
  padding-top: 22px;
  margin: 0 40px;
}
.content {
  color: #fff;
}
.presonintrduce {
  margin-top: 66px;
  margin-left: 50%;
  width: 200px;
  transform: translateX(-100px);

  .profilephoto {
    .image {
      width: 170px;
      height: 170px;
      border-radius: 50%;
    }
  }
  .cname {
    width: 200px;
    font-size: 40px;
    line-height: 56px;
    margin-top: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .ename {
    line-height: 33px;
    font-size: 24px;
    opacity: 0.74;
    width: 200px;
    margin-bottom: 20px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .attention {
    margin-left: 37px;
    padding: 0 20px;
    background-image: linear-gradient(150deg, #f25b86 0%, #f1ac5e 100%);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    border-radius: 22px;
    font-size: 28px;
    line-height: 40px;
    width: 56px;
  }
  .num {
    opacity: 0.74;
    font-size: 24px;
    margin-top: 16px;
  }
}
.intro {
  margin: 20px 40px 0;
  .selftitle {
    margin-bottom: 19px;
    font-size: 32px;
  }
  .introcontent {
    p {
      display: inline-box;
      height: 170px;
      opacity: 0.34;
      line-height: 34px;
      font-size: 24px;
      display: -webkit-box;
      text-overflow: ellipsis;
      overflow: hidden;
      -webkit-line-clamp: 4.5;
      flex-direction: column;
    }
    i {
      display: inline;
      font-size: 28px;
      color: #fbc34a;
      line-height: 40px;
      opacity: 1;
    }
  }
}
.works {
  overflow: hidden;
  .workintro {
    margin-bottom: 20px;
    display: flex;
    justify-content: flex-start;
    .workImg {
      width: 200px;
      height: 280px;
    }
    .workdetail {
      margin-top: 20px;
      margin-left: 32px;
      font-size: 28px;
      div {
        padding-bottom: 20px;
      }
      span {
        margin-left: 14px;
        opacity: 1;
      }
      .worktitle {
        font-size: 36px;
        line-height: 50px;
      }
      .workscore {
        opacity: 0.64;
        span {
          color: #fbc34a;
        }
      }
      .workactor,
      .worktime {
        opacity: 0.64;
      }
    }
  }
}
.photo {
  .photoshow {
    //  height: 456px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    .left {
      width: 384px;
      height: 456px;
      margin-right: 8px;
      .photo1 {
        width: 384px;
        height: 200px;
      }
      .photo3,
      .photo4 {
        float: left;
        width: 186px;
        height: 244px;
      }
      .photo3 {
        margin-right: 12px;
      }
    }
    .right {
      width: 278px;
      height: 456px;
      .photo2 {
        width: 278px;
        height: 456px;
      }
    }
  }
}
</style>
